﻿<paging:MtPage x:Class="SampleWindowsStoreApp.Views.VariousSamplesPage"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                     xmlns:controls="using:MyToolkit.Controls"
                     xmlns:validation="using:MyToolkit.Validation"
                     xmlns:viewModels="using:SampleWindowsStoreApp.ViewModels"
                     xmlns:paging="using:MyToolkit.Paging"
                     mc:Ignorable="d" x:Name="PageRoot">

    <paging:MtPage.Resources>
        <viewModels:VariousSamplesPageModel x:Key="ViewModel" />
    </paging:MtPage.Resources>

    <Grid DataContext="{StaticResource ViewModel}" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid Margin="120,50,40,40">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <TextBlock Style="{StaticResource SubheaderTextStyle}" Text="MyToolkit Samples" Margin="0,0,0,20" />

            <controls:MtPivot Grid.Row="1" FontSize="24">
                <!--<controls:PivotItem Header="Validation">
					<StackPanel>
						<validation:ValidationContainer x:Name="val">
							<StackPanel>
								<controls:ValidatedTextBox Header="Firstname" ErrorText="MinLength=3, MaxLength=10" MinLength="3" MaxLength="10" Margin="0,0,0,20" />
								<controls:ValidatedTextBox Header="Lastname" ErrorText="Only 'a' character allowed, MinLength=1, MaxLength=5" 
														   MinLength="1" MaxLength="5" ValidationRegularExpression="^a*$" 
														   Margin="0,0,0,20" />
							</StackPanel>
						</validation:ValidationContainer>

						<TextBlock>
							<Run Text="Errors: " /><Run Text="{Binding ElementName=val, Path=Exceptions.Count}" />
						</TextBlock>

						<ItemsControl ItemsSource="{Binding ElementName=val, Path=Exceptions}">
							<ItemsControl.ItemTemplate>
								<DataTemplate>
									<TextBlock>
										<Run Text="{Binding Value.Message}"></Run>
									</TextBlock>
								</DataTemplate>
							</ItemsControl.ItemTemplate>
						</ItemsControl>

						<Button Content="Save" IsEnabled="{Binding ElementName=val, Path=IsValid}" Margin="0,20,0,0" />
					</StackPanel>
				</controls:PivotItem>-->

                <controls:MtPivotItem Header="HtmlTextBlock">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <controls:HtmlTextBlock Html="{Binding Html}" Loaded="OnHtmlTextBlockLoaded" x:Name="HtmlTextBlock" />

                        <StackPanel Orientation="Horizontal" Grid.Row="1">
                            <Button Content="Font Size" Click="OnChangeFontSize" />
                        </StackPanel>
                    </Grid>

                </controls:MtPivotItem>

                <controls:MtPivotItem Header="Other">
                    <StackPanel>
                        <Button Content="ListPickerBox test" Click="OnListPickerBoxTest"/>

                        <controls:TextButton Content="&#xE116;" Header="TextButton" Margin="0,20,0,20"/>
                        <!-- Symbols can be read in "Characters Map" application -->

                        <StackPanel Orientation="Horizontal" Margin="0,0,0,20">
                            <controls:TextButton Content="&#xE115;" Margin="0,0,20,0"/>
                            <controls:TextButton Content="&#xE114;" Margin="0,0,20,0"/>
                            <controls:TextButton Content="&#xE113;" Margin="0,0,20,0"/>
                            <controls:TextButton Content="&#xE112;" Margin="0,0,20,0"/>
                        </StackPanel>
                    </StackPanel>
                </controls:MtPivotItem>
            </controls:MtPivot>
        </Grid>

        <Button Margin="39,59,39,0" Command="{Binding Frame.GoBackCommand, ElementName=PageRoot}"
                Style="{StaticResource NavigationBackButtonNormalStyle}" VerticalAlignment="Top"
                AutomationProperties.Name="Back"
                AutomationProperties.AutomationId="BackButton"
                AutomationProperties.ItemType="Navigation Button"/>
    </Grid>
</paging:MtPage>
